/*
 * File:   GUIGameManager.h
 * Author: root
 *
 * Created on November 15, 2008, 11:23 PM
 */

#ifndef GUIGAMEMANAGER_H
#define GUIGAMEMANAGER_H

#include <QtCore>
#include "GameManager.h"

class GUIGameManager : public QObject, public GameManager  {

  Q_OBJECT

  public:

    GUIGameManager(Player**);
    virtual void run();
    void playAgentTurns(int);
    PlayerPhase getCurrPhase() const {
      return gameState.getCurrPhase();
    }
    int getWinner() const {
      return winner;
    }

  public slots:
    void completeHumanTurn(int, const Move&);

  signals:
    void gameReport(QString);
    void gameOver();
    void agentTurnOccurred(int);

  private:
    void reportFirstDiscard();
    void updateState(int);
    void reportMove(const Move&, int);
    void checkWinner();

    int winner;
    int knockingPlayer;
    bool isGameOver;
    bool waitingForHuman;
};

#endif	/* GUIGAMEMANAGER_H */

